package record;

import com.jfinal.aop.Duang;
import com.jfinal.kit.Ret;
import common.model.User;

import java.util.Date;

public class recordService {
    public static final recordService me = Duang.duang(recordService.class);
    private static final User userDao = new User().dao();

    public Ret editEmp(String username, String pwd, String gender, Date birthday, String idCard, String area, String nativePlace) {
        User user = userDao.findFirst(userDao.getSqlPara("user.findByUsername", username));
        if (!user.setPwd(pwd).setGender(gender).setBirthday(birthday).setIdCard(idCard).setArea(area).setNativePlace(nativePlace).update()) {
            return Ret.by("status", false).set("msg", "user表异常");
        } else {
            return Ret.by("status", true);
        }
    }
}
